package com.music.core.api;

import com.music.comstan.enums.MusicProviderEnum;
import com.music.comstan.enums.MusicProviderEnum;

/**
 * @author haohua
 * @date 2018/2/11
 * music工厂类
 */
public class MusicApiFactory {
    public static MusicApi create(MusicProviderEnum provider) {
        try {
            MusicApi musicApi = provider.getMusicApiClass().newInstance();
            return musicApi;
        } catch (InstantiationException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        }
        return null;
    }
}
